package com.sikaryofficial.backend.domain.dto.resp.prize;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sikaryofficial.backend.constant.PrizeTypeEnum;
import com.sikaryofficial.system.api.model.att.AttachmentResp;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 奖品对象 prize_t
 *
 * @author qinjinyuan
 * @date 2023-11-02
 */
@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "奖品DTO对象", description = "奖品DTO对象")
public class PrizeDTO implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 奖品ID
     */
    @ApiModelProperty(value = "奖品ID", example = "0")
    private Long prizeId;

    /**
     * 奖品名称
     */
    @ApiModelProperty(value = "奖品名称", example = "奖品名称")
    private String prizeName;

    /**
     * 奖品类型:1-虚拟礼品 2-实物礼品 3-谢谢惠顾
     */
    @ApiModelProperty(value = "奖品类型:1-虚拟礼品 2-实物礼品 3-谢谢惠顾", example = "1")
    private Integer prizeType;

    @ApiModelProperty(value = "奖品类型描述", example = "1")
    private String prizeTypeDesc;
    /**
     * 奖品库存
     */
    @ApiModelProperty(value = "奖品库存", example = "0")
    private Integer prizeStock;
    /**
     * 兑换所需积分
     */
    @ApiModelProperty(value = "兑换所需积分", example = "0")
    private Integer points;
    /**
     * 奖品封面
     */
    @ApiModelProperty(value = "奖品封面", example = "奖品封面")
    private String prizeCover;
    @ApiModelProperty(value = "礼品附件列表")
    private List<AttachmentResp> attachmentList;
    /**
     * 品牌
     */
    @ApiModelProperty(value = "品牌", example = "品牌")
    private String prizeBrand;
    /**
     * 奖品功能
     */
    @ApiModelProperty(value = "奖品功能", example = "奖品功能")
    private String prizeFunction;
    /**
     * 租户号
     */
    @JsonIgnore
    private Integer tenantId;
    /**
     * 奖品功能
     */
    @ApiModelProperty(value = "是否可以兑换:false 兑换按钮不可用 true 兑换按钮可用", example = "true")
    private boolean hasRedeem;

    @ApiModelProperty(value = "礼品兑换人数", example = "12")
    private Integer redeemCount;

    /**
     * 奖品功能
     */
    @ApiModelProperty(value = "是否有被关联:false 未关联 true 有关联", example = "false")
    private boolean hasRelation;
    /**
     * 创建人账户
     */
    @ApiModelProperty(value = "创建人账户", example = "创建人账户")
    private String createdName;
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间", example = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdTime;
    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间", example = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updatedTime;

    /**
     * 是否隐藏礼品 0-显示 1-隐藏，默认0-显示
     */
    @ApiModelProperty(value = "是否隐藏礼品 0-显示 1-隐藏，默认0-显示", example = "0")
    private Integer hasHide;

    /**
     * 是否是现金 0-否 1-是，默认0-否
     */
    @ApiModelProperty(value = "是否是现金 0-否 1-是，默认0-否", example = "0")
    private Integer hasCash;

    public String getPrizeTypeDesc() {
        return PrizeTypeEnum.getNameByCode(this.prizeType);
    }
}
